Skip to content

Fix Settings switch geometry and stabilize Model Pad chrome - #101

Open
sambitcreate wants to merge 3 commits into
mainfrom
cursor/fix-toggle-switch-ui-7bbe
Open

Fix Settings switch geometry and stabilize Model Pad chrome#101
sambitcreate wants to merge 3 commits into
mainfrom
cursor/fix-toggle-switch-ui-7bbe

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

This PR still includes the Settings switch geometry fix. It also keeps the Model Pad square outline stable while surrounding copy changes, and hardens the flaky responsive Electron check.

Model Pad

  • Size the Settings square from remaining scrollport height, column width, and a fixed reservation for axis captions + legend. Live canvas − pad measurement is gone, so legend wrap and marker labels no longer resize the outline.
  • Cap the square to the visible scrollport (minus 1px) so centering in the E2E always has a geometry that can fits.
  • Composer picker details use a fixed-height card; model text scrolls inside it instead of growing the popover and shifting the pad.

Switches (unchanged intent)

Shared Switch geometry, trailing alignment on Settings rows, and overflow-visible on field cards so the Plugins-style thumb is not clipped.

Tests

  • Unit coverage for measureModelPadAvailableSize, Settings source/CSS contracts, and picker details chrome.
  • Model Pad E2E waits for in-flight view-transition animations before measuring.

Cannot run Electron E2E in this environment; scoped test:model-pad needs tsx from npm ci (registry was flaky here).

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 8, 2026 19:33
Keep the shared Switch pill from being restyled as a flex button, so the
thumb matches Plugins. Trailing switch rows stay compact and unclipped
in Field, Appearance, Memory, shortcuts, and scheduled-task lists.

Co-authored-by: Sambit Biswas <sambitcreate@users.noreply.github.com>
Reserve axis/legend height instead of measuring live canvas-minus-square
geometry, cap the square to the visible scrollport, and give composer
model details a fixed card so picking models no longer resizes the pad.

Co-authored-by: Sambit Biswas <sambitcreate@users.noreply.github.com>
@cursor cursor Bot changed the title Fix Settings toggle alignment and switch chrome Fix Settings switch geometry and stabilize Model Pad chrome Sep 8, 2026
@sambitcreate
sambitcreate marked this pull request as ready for review September 8, 2026 20:49

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one robustness suggestion inline. The geometry refactor reads coherently: the fixed chrome reservation and grid-only observation remove the label-wrap feedback loop, the measure math is consistent with the CSS caps, the source-reading contracts match the actual CSS/TSX, and all 98 focused unit tests pass.

Reviewed changes

  • Model Pad measurementmeasureModelPadAvailableSize extracted into renderer/lib/model-pad-layout.ts with exported MIN_SIZE/CHROME/GUTTER constants; settings layout effect now observes only grid + scrollport and reserves 128px of fixed chrome instead of measuring live labels/legend, so legend wrap and marker labels can no longer resize the square outline.
  • Model Pad CSS.model-pad gains aspect-ratio: 1/1, flex-shrink: 0, align-self: start, min-width: 0; .model-pad-legend reserves min-height: 2.5rem; square is additionally capped to the visible scrollport minus 1px.
  • Composer picker details cardModelHoverDetails is now a fixed-height (min(22.5rem, 70vh)) column with an internal scroll area and pointer-events-auto, so popover height no longer shifts while model copy or catalog text changes.
  • Switch geometry — shared Switch root is inline-flex items-center shrink-0 overflow-visible with a pointer-events-none thumb; settings Field rows carry has-[[role=switch]] trailing-switch columns; group/appearance cards drop overflow: hidden so the Plugins-style thumb is not clipped.
  • Trailing alignmentitems-center on git-push and shortcut rows, removed max-[540px]:justify-start in remote-access settings, new narrow-container :has([role="switch"]) appearance rules.
  • Docs & testssettings-design-system.md row updated to the reserved-chrome contract; unit tests for the measure function, settings source/CSS contracts, memory-settings copy placement, and picker chrome; E2E waits for in-flight view-transition animations before measuring.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using DeepSeek Flash𝕏

Comment thread tests/e2e/model-pad-responsive.spec.ts Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. The previously flagged unbounded animation wait is now genuinely bounded: infinite-iteration animations are excluded via the finite-endTime filter, anything still pending is capped by the 500 ms race, and the infinite sentinel makes the old hang reproduce deterministically on regression rather than only when a spinner happens to be animating.

Reviewed changes

  • Bounded Model Pad E2E wait — the pre-measure wait now snapshots document.getAnimations(), filters to animations whose computed endTime is finite (endTime: Infinity for infinite iterations, so perpetual spinners drop out), and races Promise.allSettled(finished) against a 500 ms cap — paused or never-ending animations can no longer stall the merge-gate spec until the Playwright action timeout.
  • Infinite-animation sentinel — a 1px, opacity-0, infinite-rotation element is appended to the page for the whole test, so the original unbounded-wait failure fails loudly on regression; the sentinel also exercises the filter on every panel iteration.
  • Papercut documented.papercuts/troubleshooting.md records the animation.finished never-settles rule and keeps geometry polling authoritative for E2E readiness.

Pullfrog  | View workflow run | Using DeepSeek Flash𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants